import request from "./request.js";

// #region person 用户中心
/**
 * 登录
 * @param {Object} data
 */
export function phoneLogin(data) { 
	return request({
		url: '/front/user/login',
		method: "post",
		data
	})
}

/**
 * 获取用户信息
 * @param {Object} data
 */
export function getMemberCenterInfo(data) { 
	return request({
		url: '/front/user/memberCenter',
		method: "get",
		params: data
	})
}

/**
 * 查看用户信息
 * @param {Object} data
 */
export function getUserInfo(data) { 
	return request({
		url: '/front/user/userInfo',
		method: "get",
		params: data
	})
}

/**
 * 保存用户信息
 * @param {Object} data
 */
export function saveUserInfo(data) { 
	return request({
		url: '/front/user/userInfoSave',
		method: "post",
		msg: true,
		data
	})
}

// 会员中心
export function queryMembercenter(data) { 
	return request({
		url: '/front/user/memberCenter',
		method: "get",
		params: data
	})
}

// 保存openid
export function saveOpenIdSave(data) { 
	return request({
		url: '/front/user/wxOpenidSave',
		method: "post",
		data
	})
}

// #endregion


// #region home 首页
/**
 * 首页 - 活动列表
 * @param {Object} data
 */
export function getHomeActList(data) { 
	return request({
		url: '/front/homepage/actList',
		method: "post",
		data
	})
}

/**
 * 首页 - 获取配置
 * @param {Object} data
 */
export function getHomePageConfig(data) { 
	return request({
		url: '/front/homepage/configList',
		method: "post",
		data
	})
}

// #endregion


// #region 订单相关

/**
 * 首页 - 订单核销
 * @param {Object} data
 */
export function orderVerifyByOrderNo(data) { 
	return request({
		url: '/front/order/orderVerif',
		method: "get",
		params: data
	})
}

/**
 * 核销列表
 */
export function orderVerifList(data) { 
	return request({
		url: '/front/order/orderVerifList',
		method: "post",
		data
	})
}

/**
 * 历史订单
 * @param {Object} data
 */
export function getHistoryOrderList(data) { 
	return request({
		url: '/front/order/orderList',
		method: "post",
		data
	})
}

// 下单
export function setOrderSave(data) { 
	return request({
		url: '/front/order/orderSave',
		method: "post",
		data
	})
}
// 获取积分兑换比例
export function getOrderPreDetail(data) { 
	return request({
		url: '/front/order/orderPreDetail',
		method: "get",
		params: data
	})
}

// 获取下单参数
export function getOrderPay(data) { 
	return request({
		url: '/front/order/orderPay',
		method: "post",
		data
	})
}

// 获取订单的详情
export function getOrderDetail(data) { 
	return request({
		url: '/front/order/orderDetail',
		method: "get",
		params: data
	})
}

// 取消支付
export function getOrderCancle(data) { 
	return request({
		url: '/front/order/orderCancel',
		method: "get",
		params: data,
		msg: true,
	})
}


// #endregion


// #region 积分相关
/**
 * 积分 - 获取积分详情
 * @param {Object} data
 */
export function pointDetail(data) { 
	return request({
		url: '/front/point/pointDetail',
		method: "post",
		data
	})
}

// #endregion


// #region 活动相关
/**
 * 获取活动的类型
 * @param {Object} data
 */
export function getTypeList(data) { 
	return request({
		url: '/front/act/actTypeList',
		method: "post",
		params: data
	})
}


/**
 * 获取活动的列表
 * @param {Object} data
 */
export function getActList(data) { 
	return request({
		url: '/front/act/actList',
		method: "post",
		data
	})
}

export function getActDetail(data) { 
	return request({
		url: '/front/act/actDetail',
		method: "get",
		params: data
	})
}


// #endregion


// #region 会议室&自习室
	export function getMeetingList(data) {
		return request({
			url: '/front/shareSpace/meetingList',
			method: "post",
			data: data
		})
	}
	export function getShareSpaceDeatil(data) {
		return request({
			url: '/front/shareSpace/detail',
			method: "get",
			params: data
		})
	}
	
	export function getMemberHomeCode(data) {
		return request({
			url: '/front/user/refreshMemberCode',
			method: "get",
			params: data
		})
	}
	
	
// #endregion